package cn.wen233.spring.config;

import cn.wen233.spring.discovery.SunglowDiscoveryClient;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自动配置
 *
 * @author wenei
 * @date 2021-10-26 19:58
 */
@Configuration
@EnableConfigurationProperties({SunglowProperties.class})
@AutoConfigureAfter({SunglowProperties.class})
public class SunglowAutoConfiguration {

    @Bean
    public SunglowDiscoveryClient sunglowDiscoveryClient(SunglowProperties sunglowProperties) {
        return new SunglowDiscoveryClient(sunglowProperties);
    }
}
